Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NO-JIRA: ci/get-ocp-repo.sh: add --output-dir #1702

Merged
merged 3 commits into from
Dec 19, 2024

Conversation

jlebon
Copy link
Member

@jlebon jlebon commented Dec 19, 2024

In the node layering case, we're directly bind-mounting the build context dir. It's mounted read-only, so we can't write ocp.repo there. And even if we could, we shouldn't modify the build context if we don't need to.

Add a new --output-dir option to allow changing the directory to which to write ocp.repo. Use this in the node layering flow to output to /run/yum.repos.d, which is an already established API for transient repo definitions.

Prep for adding another option, which would then make the getopt option
more obviously cleaner than the ad-hoc approach.
There is no cosa workdir when building the extensions image or the node
image and so we shouldn't reference the `cosa_workdir` variable. Instead
output the repo file to the same directory in which the OCP manifest is.
In the node layering case, we're directly bind-mounting the build
context dir. It's mounted read-only, so we can't write `ocp.repo` there.
And even if we could, we shouldn't modify the build context if we don't
need to.

Add a new `--output-dir` option to allow changing the directory to which
to write `ocp.repo`. Use this in the node layering flow to output to
`/run/yum.repos.d`, which is an already established API for transient
repo definitions.
@jlebon
Copy link
Member Author

jlebon commented Dec 19, 2024

This was successfully tested in openshift/release#59490 (well, the node layering flow).

@openshift-ci openshift-ci bot requested review from jbtrystram and travier December 19, 2024 17:13
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 19, 2024
Copy link
Contributor

openshift-ci bot commented Dec 19, 2024

@jlebon: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

*) echo "$0: invalid argument: $1" >&2; exit 1;;
esac
shift
done
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previously --cosa-workdir and --ocp-layer were exclusive, or at least only the first one would be considered. Do we want to do anything specific if a user passed both here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah... when switching to getopt, keeping that check didn't feel worth the lines. The current behaviour of just letting --ocp-layer win seemed fine to me. This script doesn't need a lot of polish. All users of it are in this repo.

Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@jlebon jlebon changed the title ci/get-ocp-repo.sh: add --output-dir NO-JIRA: ci/get-ocp-repo.sh: add --output-dir Dec 19, 2024
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Dec 19, 2024
@openshift-ci-robot
Copy link

@jlebon: This pull request explicitly references no jira issue.

In response to this:

In the node layering case, we're directly bind-mounting the build context dir. It's mounted read-only, so we can't write ocp.repo there. And even if we could, we shouldn't modify the build context if we don't need to.

Add a new --output-dir option to allow changing the directory to which to write ocp.repo. Use this in the node layering flow to output to /run/yum.repos.d, which is an already established API for transient repo definitions.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@dustymabe
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 19, 2024
Copy link
Contributor

openshift-ci bot commented Dec 19, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dustymabe, jlebon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jlebon
Copy link
Member Author

jlebon commented Dec 19, 2024

This is only used in CI, which passed.

/label acknowledge-critical-fixes-only

@openshift-ci openshift-ci bot added the acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. label Dec 19, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 21a3966 into openshift:master Dec 19, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants